﻿using System;
using System.Globalization;
using System.Windows.Data;
using SuppKids.ViewModels.MenuRaskladka;

namespace SuppKids.Converters
{
	public class ResultListItemToChildrenCountConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			var source = value as ResultListItem;
			var groupsViewModel = parameter as GroupsViewModel;
			return source != null && groupsViewModel != null ? groupsViewModel.ChildrenCount[source.MealType] : 0;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}